import { IRes, GetAllThingTypeReq, UpdateThingTypeReq, addThingTypeReq, removeThingTypeReq } from '../type/thingType'
import $http from '@/utils/http/index'


/**
 * 获取所有启事类别
 * @param data 参数
 * @returns 
 */
export function getThingType(data: GetAllThingTypeReq) {
  return $http.get<IRes>({
    url: "/api/thing/getAllThingType",
    params: data
  });
}

/**
 * 更新启事类别
 * @param data 
 * @returns 
 */
export function updateThingType(data: UpdateThingTypeReq) {
  return $http.patch<IRes>({
    url: "/api/thing/updateTypeById",
    data
  });
}

/**
 * 增加启事类别
 */
export function addThingType(data: addThingTypeReq) {
  return $http.post<IRes>({
    url: "/api/thing/addThingType",
    data
  });
}

/**
 * 删除启事类别
 */
export function removeThingType(data: removeThingTypeReq) {
  return $http.delete<IRes>({
    url: "/api/thing/removeThingType",
    params: data
  });
}